﻿<?php
include "../../templates/db/db.php";
?>
<script type='text/javascript'>
	alert('Вие представихте успешно урок!');
</script>

<?php



$sel_all = 'SELECT * FROM articles WHERE article_id='.$_GET['id'].'';
$sel_all_q = mysql_query($sel_all);
$sel_f = mysql_fetch_assoc($sel_all_q);


$sel_title = mysql_query('SELECT * FROM groups WHERE id ='.$_GET['id_gr'].'');
$row_title = mysql_fetch_assoc($sel_title);

	$usernaame = $_SESSION['username'];
	$title_grouup = $sel_f['article_descr'];
	
	$ins_tut = 'INSERT INTO homework(`username`, `title_group`, `date`, `descr`) 
					VALUES("'.$usernaame.'", "'.$row_title['title_group'].'", '.time().', "'.$title_grouup.'")';
	$ins_tut_q = mysql_query($ins_tut);
?>
<meta http-equiv="refresh" content="0;<?php echo '../users.php?mode=third' ?>">